<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>10.Vue生命周期</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <h1>10.Vue生命周期</h1>
    <div id="app">
        {{username}}
    </div>
    <script>

        const vm = new Vue({
            el: '#app',
            data: {
                username: 'laoxie'
            },
            beforeCreate() {
                console.log('beforeCreate.username=', this.username)
            },
            created() {
                console.log('created.username=', this.username)
            },
            beforeMount() {
                console.log('beforeMounte=',  document.querySelector('#app').innerHTML)
            },
            mounted() {
                console.log('mounted=', document.querySelector('#app').innerHTML)
            },
            beforeUpdate(){
                console.log('beforeUpate=', document.querySelector('#app').innerHTML)
            },
            updated(){
                console.log('updated=', document.querySelector('#app').innerHTML)
            },
            beforeDestroy(){
                console.log('beforeDestroy')
            },
            destroyed(){
                console.log('destroyed')
            }
        })
    </script>
</body>

</html>